package com.joseph.websocket.component;

import io.netty.channel.Channel;

import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

public class NodeManager {

    private static final Map<String, Channel> nodes = new ConcurrentHashMap<>();

    public static void add(String node, Channel channel) {
        nodes.put(node, channel);
    }

    public static Channel get(String node) {
        return nodes.get(node);
    }

    public static void remove(String node) {
        nodes.remove(node);
    }

}
